{extend name="public:base" /}


{block name="content"}
	  <!-- 搜索 开始 -->
    <div class="back_btn">
        <!-- 返回按钮 -->
            <button class="btn btn_color" type="button" style="outline: none;">
                <a href="{:url('index')}"><span class="glyphicon glyphicon-arrow-left" style="color:#3c8dbc;font-size: 18px;"></span></a>
            </button>
            <button type="button" class="btn btn-info btn-xs pull-right " style="margin: 10px 10px;">
                <a href="{:url('index')}">返回首页</a>
            </button>
        <!-- 输入id查询 -->
        <div class="choose_btn">
            <a class="btn btn-primary" role="button" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
              筛选
            </a>
            <div class="collapse" id="collapseExample">
                <div class="well well_">
                    <!-- 输入id选择 -->
                    <form method="post" action="{:url('index/listing')}">
                        <div class="search d3">
                                <input type="text" name="id_phonenum" value="{$form.id_phonenum}" placeholder="请输入ID或手机号...">
                                <button type="submit"> <span class="glyphicon glyphicon-search" style="color:#e2b069;font-size: 18px;"></span></button>
                        </div>
                        <!-- 时间段选择 -->
                        <div  style=" cursor: pointer; width: 100%;margin-top: 10px;margin-bottom: 10px;">
                            <h6>建单时间：</h6>
                            <input type="text" name="jdtime" id="jdtime" value="{$form.jdtime}" class="form-control" placeholder="选择时间" style="height:35px;border:1px solid #e5e5e5;border-radius: 0px;outline: none;" />
                        </div>
                        <!-- 地区选择 -->
                        <div class="form-group" style="margin-top: 10px;">
                            <h6>地区：</h6>
                            <select class="form-control" name="area" id="area">
                                <option value="">全部</option>
                                {volist name='area' id='data'}
                                <option value="{$data.id}" {eq name="form['area']" value="$data.id"}selected="selected"{/eq} >{$data.name}</option>
                                {/volist}
                            </select>
                        </div>
                        <!-- 医院选择 -->
                        <div class="form-group" style="margin-top: 10px;">
                            <h6>医院：</h6>
                            <select class="form-control" name="yiyuan" id="yiyuan">
                                <option value="">全部</option>
                                {volist name='yiyuan' id='data'}
                                <option value="{$data.id}" {eq name="form['yiyuan']" value="$data.id"}selected="selected"{/eq} >{$data.name}</option>
                                {/volist}
                            </select>
                        </div>
                        <div class="form-group" style="margin-top: 10px;">
                            <h6>业务状态：</h6>
                            <select class="form-control" name="ywstate">
                                <option value="">全部</option>
                                {volist name='ywstate' id='data'}
                                <option value="{$data.id}" {eq name="form['ywstate']" value="$data.id"}selected="selected"{/eq} >{$data.name}</option>
                                {/volist}
                            </select>
                        </div>

                        <div class="form-group" style="margin-top: 10px;">
                            <h6>邀约客服：</h6>
                            <select class="form-control" name="yykf">
                                <option value="">全部</option>
                                {volist name='yykf' id='data'}
                                <option value="{$data.id}" {eq name="form['yykf']" value="$data.id"}selected="selected"{/eq} >{$data.username}</option>
                                {/volist}
                            </select>
                        </div>

                        <!-- 追踪 -->
                        {eq name="$form['today_xinxi']" value="today_zhuizong"}
                            <div  style=" cursor: pointer; width: 100%;margin-top: 10px;margin-bottom: 10px;">
                                <h6>追踪时间：</h6>
                                <input type="text" name="zztime" id="zztime" value="{$form.zztime}" class="form-control" placeholder="选择时间" style="height:35px;border:1px solid #e5e5e5;border-radius: 0px;outline: none;" />
                            </div>
                        {/eq}
                        <!-- 邀约拍摄 、拍摄成功、取消 -->
                        {if condition=" $form['today_xinxi'] == 'today_yaoyuepaishe' OR $form['today_xinxi'] == 'today_quxiaopaishe' OR $form['today_xinxi'] == 'today_paishechenggong' "}
                            <div class="form-group">
                                <h6>摄影场馆</h6>
                                <select class="form-control" name="yycg">
                                    <option value="">全部</option>
                                    {volist name='yycg' id='data'}
                                    <option value="{$data.id}" {eq name="form['yycg']" value="$data.id"}selected="selected"{/eq} >{$data.title}</option>
                                    {/volist}
                                </select>
                            </div>
                        {/if}
                        <!-- 邀约拍摄-->
                        {eq name="$form['today_xinxi']" value="today_yaoyuechenggong"}
                            <div style=" cursor: pointer; width: 100%;margin-top: 10px;margin-bottom: 10px;">
                                <h6>预约成功拍摄时间：</h6>
                                <input type="text" name="yycgtime" id="yycgtime" value="{$form.yycgtime}" class="form-control" placeholder="选择时间" style="height:35px;border:1px solid #e5e5e5;border-radius: 0px;outline: none;" />
                            </div>
                        {/eq}
                        <!-- 拍摄成功、取消 -->
                        {eq name="$form['today_xinxi']" value="today_quxiaopaishe"}
                            <div  style=" cursor: pointer; width: 100%;margin-top: 10px;margin-bottom: 10px;">
                                <h6>取消拍摄时间：</h6>
                                <input type="text" name="qxpstime" id="qxpstime" value="{$form.qxpstime}" class="form-control" placeholder="选择时间" style="height:35px;border:1px solid #e5e5e5;border-radius: 0px;outline: none;" />
                            </div>
                        {/eq}
                        {eq name="$form['today_xinxi']" value="today_paishechenggong"}
                            <div  style=" cursor: pointer; width: 100%;margin-top: 10px;margin-bottom: 10px;">
                                <h6>拍摄成功时间：</h6>
                                <input type="text" name="cgpstime" id="cgpstime" value="{$form.cgpstime}" class="form-control" placeholder="选择时间" style="height:35px;border:1px solid #e5e5e5;border-radius: 0px;outline: none;" />
                            </div>
                        {/eq}

                        {eq name="$form['today_xinxi']" value="today_fenpeidingdan"}
                            <div  style=" cursor: pointer; width: 100%;margin-top: 10px;margin-bottom: 10px;">
                                <h6>分配时间：</h6>
                                <input type="text" name="yyfptime" id="yyfptime" value="{$form.yyfptime}" class="form-control" placeholder="选择时间" style="height:35px;border:1px solid #e5e5e5;border-radius: 0px;outline: none;" />
                            </div>
                        {/eq}

                        <!--课程-->
                        {eq name="$form['today_xinxi']" value="today_baomingkecheng"}
                            <div class="form-group">
                                <h6>课程</h6>
                                <select class="form-control" name="kcid">
                                    <option value="">全部</option>
                                    {volist name='kecheng' id='data'}
                                    <option value="{$data.id}" {eq name="form['kcid']" value="$data.id"}selected="selected"{/eq} >{$data.name}</option>
                                    {/volist}
                                </select>
                            </div>
                            <div class="form-group">
                                <h6>报名时间</h6>
                                <input type="text" class="form-control form-time"  id="yysktime" name="yysktime" value="{$form.yysktime}" >
                            </div>
                            <div class="form-group">
                                <h6>会所门店</h6>
                                <select class="form-control" name="hsdzid">
                                    <option value="">全部</option>
                                    {volist name='hdmd' id='data'}
                                    <option value="{$data.id}" {eq name="form['hsdzid']" value="$data.id"}selected="selected"{/eq} >{$data.title}</option>
                                    {/volist}
                                </select>
                            </div>
                        {/eq}
                        {eq name="$form['today_xinxi']" value="today_yuyuepaishe"}
                            <div class="form-group">
                                <h6>预约拍摄时间</h6>
                                <input type="text" class="form-control form-time"  id="yypstime" name="yypstime" value="{$form.yypstime}" >
                            </div>
                        {/eq}
                        {eq name="$form['today_xinxi']" value="today_paishe"}
                            <div class="form-group">
                                <h6>拍摄成功时间</h6>
                                <input type="text" class="form-control form-time"  id="cgpstime" name="cgpstime" value="{$form.cgpstime}" >
                            </div>
                        {/eq}
                        {eq name="$form['today_xinxi']" value="today_fenpei"}
                            <div class="form-group">
                                <h6>活动会所分配时间</h6>
                                <input type="text" class="form-control form-time"  id="hsfptime" name="hsfptime" value="{$form.hsfptime}" >
                            </div>
                            <div class="form-group">
                                <h6>会所专员</h6>
                                <select class="form-control" name="hszyid">
                                    <option value="">全部</option>
                                    {volist name='hszy' id='data'}
                                    <option value="{$data.id}" {eq name="form['hszyid']" value="$data.id"}selected="selected"{/eq} >{$data.username}</option>
                                    {/volist}
                                </select>
                            </div>
                        {/eq}
                        {eq name="$form['today_xinxi']" value="today_baoming"}
                            <div class="form-group">
                                <h6>预约上课时间</h6>
                                <input type="text" class="form-control form-time"  id="yysktime" name="yysktime" value="{$form.yysktime}" >
                            </div>
                        {/eq}

                        {eq name="$form['today_xinxi']" value="today_quxiaobaoming"}
                            <div class="form-group">
                                <h6>会所取消上课时间</h6>
                                <input type="text" class="form-control form-time"  id="qxyytime" name="qxyytime" value="{$form.qxyytime}" >
                            </div>
                        {/eq}

                        {eq name="$form['today_xinxi']" value="today_weidao"}
                            <div class="form-group">
                                <h6>会所旷课时间</h6>
                                <input type="text" class="form-control form-time"  id="hskktime" name="hskktime" value="{$form.hskktime}" >
                            </div>
                        {/eq}

                        {eq name="$form['today_xinxi']" value="today_fankui"}
                            <div class="form-group">
                                <h6>反馈部门</h6>
                                <select class="form-control" name="fkbm" id="fkbm">
                                    <option value="">全部</option>
                                    {volist name='bumen' id='data'}
                                    <option value="{$data.id}" {eq name="form['fkbm']" value="$data.id"}selected="selected"{/eq} >{$data.name}</option>
                                    {/volist}
                                </select>
                            </div>
                            <div class="form-group">
                                <h6>反馈人员</h6>
                                <select class="form-control" name="fkry" id="fkry">
                                    <option value="">全部</option>
                                    {volist name='fkry' id='data'}
                                    <option value="{$data.id}" {eq name="form['fkry']" value="$data.id"}selected="selected"{/eq} >{$data.username}</option>
                                    {/volist}
                                </select>
                            </div>
                            <div class="form-group">
                                <h6>反馈时间</h6>
                                <input type="text" class="form-control form-time"  id="fktime" name="fktime" value="{$form.fktime}" >
                            </div>
                        {/eq}

                        <input  name="today_xinxi" type="hidden" value="{$form['today_xinxi']}">
                        <!-- 筛选 -->
                        <button class="btn btn_choose" type="submit" style="outline: none;border:none;">按照以上条件筛选</button>
                    </form>
                </div>

            </div>
        </div>
       
    </div>
    <!-- 搜索 结束 -->
    <!-- 列表 -->
    <table class="table table-bordered table_color">
       <thead>
         <tr>
           <th>ID</th>
           <th>姓名</th>
           <th>妈妈电话</th>
             {if condition=" $form['today_xinxi'] == 'today_yaoyuepaishe' "}
             <th>邀约拍摄时间</th>
             {elseif condition=" $form['today_xinxi'] == 'today_quxiaopaishe' " /}
             <th>取消拍摄时间</th>
             {elseif condition=" $form['today_xinxi'] == 'today_paishechenggong' " /}
             <th>成功拍摄时间</th>
             {elseif condition=" $form['today_xinxi'] == 'today_zhuizong' " /}
             <th>追踪时间</th>
             {elseif condition=" $form['today_xinxi'] == 'today_fenpeidingdan' " /}
             <th>分配时间</th>
             {elseif condition=" $form['today_xinxi']" == 'today_baoming' " /}
             <th>预约上课时间</th>
             {elseif condition=" $form['today_xinxi'] == 'today_quxiaobaoming' " /}
             <th>取消上课时间</th>
             {elseif condition=" $form['today_xinxi'] == 'today_weidao' " /}
             <th>旷课时间</th>
             {elseif condition=" $form['today_xinxi'] == 'today_fankui' " /}
             <th>反馈时间</th>
             {else/}
             <th>建单时间</th>
            {/if}
           <th>业务状态</th>
         </tr>
       </thead>
       <tbody>
       {volist name='list' id="vo"  key="ev"  empty="暂时没有数据" }
         <tr role="button" data-toggle="collapse" href="#{$ev}" aria-expanded="false" aria-controls="collapseExample">

           <td>{$vo.id}</td>
           <td>{$vo.name}</td>
           <td>{$vo.maphone}</td>

             {if condition=" $form['today_xinxi'] == 'today_yaoyuepaishe' "}
                <td>{eq name="vo.yypstime" value="1970-01-01 8:00"}{else/}{$vo.yypstime}{/eq}</td>
             {elseif condition=" $form['today_xinxi'] == 'today_quxiaopaishe' " /}
                <td>{eq name="vo.qxpstime" value="1970-01-01"}{else/}{$vo.qxpstime}{/eq}</td>
             {elseif condition=" $form['today_xinxi'] == 'today_paishechenggong' " /}
                <td>{eq name="vo.cgpstime" value="1970-01-01"}{else/}{$vo.cgpstime}{/eq}</td>
             {elseif condition=" $form['today_xinxi'] == 'today_zhuizong' " /}
                 <td>{eq name="vo.zztime" value="1970-01-01"}{else/}{$vo.zztime}{/eq}</td>
             {elseif condition=" $form['today_xinxi'] == 'today_fenpeidingdan' " /}
                 <td>{eq name="vo.yyfptime" value="1970-01-01"}{else/}{$vo.yyfptime}{/eq}</td>
             {elseif condition=" $form['today_xinxi']" == 'today_baoming' " /}
                <td>{eq name="vo.yysktime" value="1970-01-01 8:00"}{else/}{$vo.yysktime}{/eq}</td>
             {elseif condition=" $form['today_xinxi'] == 'today_quxiaobaoming' " /}
                 <td>{eq name="vo.qxyytime" value="1970-01-01"}{else/}{$vo.qxyytime}{/eq}</td>
             {elseif condition=" $form['today_xinxi'] == 'today_weidao' " /}
                <td>{eq name="vo.hskktime" value="1970-01-01"}{else/}{$vo.hskktime}{/eq}</td>
             {elseif condition=" $form['today_xinxi'] == 'today_fankui' " /}
                <td>{eq name="vo.fktime" value="1970-01-01"}{else/}{$vo.fktime}{/eq}</td>
             {else/}
                 <td>{eq name="vo.jdtime" value="1970-01-01 8:00"}{else/}{$vo.jdtime}{/eq}</td>
             {/if}

           <!--<td>{eq name="vo.jdtime" value="1970-01-01 8:00"}{else/}{$vo.jdtime}{/eq}</td>-->

           <!--<td><span class="color{$vo.ywstate}">{$vo.state_text}</span></td>-->
             <td><span style="background-color: {$vo.color_text};">{$vo.state_text}</span></td>
         </tr>
         <tr id="details_open" style="background: none;border:0;">
            <td colspan="6" style="background: none;padding:0;">
                <div class="collapse" id="{$ev}">
                    <div class="well">
                        <div class="well_div_1">
                            <ul class="details_ul">
                                <li>姓名：{$vo.name}</li>
                                <li>妈妈电话：{$vo.maphone}</li>
                                <li>家人电话：{$vo.otherphone}</li>
                                <li>微信：{$vo.weixin}</li>
                                <li>QQ：{$vo.qq}</li>
                                <li>预产期：{eq name="vo.yctime" value="1970-01-01"}{else/}{$vo.yctime}{/eq}</li>
                                <li>业务分类：{$vo.lbxx_text}</li>
                                <!--<li style="border-bottom: 1px solid #f1a417;overflow: hidden;">业务状态：<span class="color{$vo.ywstate}">{$vo.state_text}</span></li>-->
                                <li style="border-bottom: 1px solid #f1a417;overflow: hidden;">业务状态：<span style="background-color: {$vo.color_text};">{$vo.state_text}</span></li>
                                <li>渠道来源：{$vo.qdxx_text}</li>
                                <li>地区：{$vo.area_text}</li>
                                <li>收集医院：{$vo.yyxx_text}</li>
                                <li style="border-bottom: 1px solid #f1a417;overflow: hidden;">医院渠道：{$vo.menzhen_text}</li>
                                <li>邀约客服：{$vo.yykf_text}</li>
                                <li>预约场馆:{$vo.yycg_text}</li>
                                <li>预约拍摄时间:{eq name="vo.yypstime" value="1970-01-01 8:00"}{else/}{$vo.yypstime}{/eq}</li>
                                <li>取消拍摄时间:{eq name="vo.qxpstime" value="1970-01-01"}{else/}{$vo.qxpstime}{/eq}</li>
                                <li>未到拍摄时间:{eq name="vo.wdpstime" value="1970-01-01"}{else/}{$vo.wdpstime}{/eq}</li>
                                <li style="border-bottom: 1px solid #f1a417;overflow: hidden;">追踪日期:{eq name="vo.zztime" value="1970-01-01"}{else/}{$vo.zztime}{/eq}</li>
                                <li>活动门店：{$vo.hsmd_text}</li>
                                <li>会所专员：{$vo.hszy_text}</li>
                                <li>会所状态：{$vo.hszt_text}</li>
                                <li>课程:{$vo.kcxx_text}</li>
                                <li style="border-bottom: 1px solid #f1a417;overflow: hidden;">预约上课时间：{eq name="vo.yysktime" value="1970-01-01 8:00"}{else/}{$vo.yysktime}{/eq}</li></li>
                                <li>建单人员：{$vo.jdry_text}</li>
                                <li>建单部门：{$vo.bumen_text}</li>
                                <li>建单日期：{eq name="vo.jdtime" value="1970-01-01 8:00"}{else/}{$vo.jdtime}{/eq}</li>
                                <li style="border-bottom: 1px solid #f1a417;overflow: hidden;">反馈人员：{$vo.fkry_text}</li>
                                <li>渠道备注：{neq name='vo.qdbz' value='0'}{$vo.qdbz}{/neq}</li>
                                <li>会所备注：{neq name='vo.hsbz' value='0'}{$vo.hsbz}{/neq}</li>
                                <li>邀约备注：{neq name='vo.yybz' value='0'}{$vo.yybz}{/neq}</li>
                                <li>拍摄备注：{neq name='vo.psbz' value='0'}{$vo.psbz}{/neq}</li>
                            </ul>
                        </div>
                        <div class="well_div_2"><a class="url" url="{:url('index/getQuanxian',['id'=>$vo['id']])}">操作</a></div>
                    </div>
                </div>
            </td>
        </tr>
       {/volist}

        </tbody>
    </table>
    <!-- 翻页 -->
    <div class="page_div">{$page}
    </div>
{/block}
{block name="js"}
<script type="text/javascript" src="__JS__/jquery-3.2.0.min.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/moment.js"></script>
<script type="text/javascript" src="__JS__/daterangepicker.js"></script>
<script type="text/javascript" src="__JS__/index.js"></script>


    <script type="text/javascript" src="__STATIC__/validate/jquery.validate.min.js"></script>
    <script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
    <script type="text/javascript" src="__JS__/date.js"></script>
    <script type="text/javascript" src="__JS__/yewu.js"></script>
    <script type="text/javascript">
        $(function() {

            var start = moment().subtract(29, 'days');
            var end = moment();

            function cb(start, end) {
                $('#reportrange input').val(start.format('YYYY/MM/DD') + ' - ' + end.format('YYYY/MM/DD'));
            }

            $('#reportrange').daterangepicker({
                startDate: start,
                endDate: end,
                ranges: {
                    '今天': [moment(), moment()],
                    '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                    '过去7天': [moment().subtract(6, 'days'), moment()],
                    '过去30天': [moment().subtract(29, 'days'), moment()],
                    '这个月': [moment().startOf('month'), moment().endOf('month')],
                    '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
                },
                locale : {
                    applyLabel : '确定',
                    cancelLabel : '取消',
                    fromLabel : '起始时间',
                    toLabel : '结束时间',
                    customRangeLabel : '自定义',
                    // daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
                    // monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
                    // '七月', '八月', '九月', '十月', '十一月', '十二月' ],
                    // firstDay : 1
                }
            }, cb);

            cb(start, end);
            $('#reportrange input').val("{$search.jdtime}");
        });

        $('.url').click(function () {
               var a= $(this).attr('url');
                $.get(a,  function (data) {
                    if (data.status == 1) {
                        window.location.href = data.url;
                    } else {
                        layer.msg(data.msg, {icon: 5}, function (index) {
                            layer.close(index);
                        });
                        return false;
                    }
                }, "json");
                return false;
        });
    </script>
{/block}